package de.tudarmstadt.ukp.muip.fibqdojo;

import de.tudarmstadt.ukp.muip.fibqdojo.interfaces.IFIBQSentenceToken;
import de.tudarmstadt.ukp.muip.fibqdojo.interfaces.IFIBQToken;
import de.tudarmstadt.ukp.muip.fibqdojo.interfaces.IStructureVisitor;

/**
 * A sentence token wraps a <code>IFIBQToken</code> and provides additional
 * information about its position in the sentence as zero relative index.
 * Additional a sentence token can be marked for further processing.
 * 
 * @author Tobias Horsmann
 */
public class SentenceToken implements IFIBQSentenceToken {

    private final IFIBQToken token;
    private final int position;
    private boolean isMarked;
    private boolean simplify;

    public SentenceToken(IFIBQToken token, int position) {
        this.token = token;
        this.position = position;
    }

    @Override
    public Integer getSentencePosition() {
        return position;
    }

    @Override
    public boolean isMarkedBlank() {
        return isMarked;
    }
    
    @Override
    public void setBlank(boolean mark) {
        isMarked = mark;
    }
    
    @Override
    public boolean isMarkedSimplifed(){
        return simplify;
    }
    
    @Override
    public void setSimplify(boolean simplify){
        this.simplify = simplify;
    }

    public IFIBQToken getToken() {
        return token;
    }

    public void accept(IStructureVisitor visitor) {
        visitor.visit(this);
    }

}
